# This code is part of the MWP System
# Copyright (c) 2012 Benjamin Lubin (blubin@bu.com) 
# Published under and subject to the GPLv2 license available at http://www.gnu.org/licenses/gpl-2.0.html

'''
Created on Dec 18, 2012
@author: blubin
'''

from frontend.roleApplication import RoleApplication;
from frontend.form import Type;
from unique import UNIQUE

class BrianApplication(RoleApplication):
    """ The Brian User Interface """

    def __init__(self):
        super(BrianApplication, self).__init__("CallCenter"+UNIQUE, "Brian");
        self.register_transition_step("EvaluateProblem", self.evaluate_problem, name_fields=["sequence", "FirstName", "LastName", "Policy"]);
        self.register_transition_step("ProvideAnswer", self.give_answer, name_fields=["sequence", "FirstName", "LastName", "Policy"]);
#         self.register_transition_step("AskManager", self.ask_manager, name_fields=["sequence", "FirstName", "LastName", "Policy"]);

    def evaluate_problem(self, stepname, form):
        print "brian: evaluation_complete"
        # print out solution here
        form.add_task_label(fields=["LastName", "ProblemDescription"]);
        # acknowledge answer
        form.add_field(Type.BOOLEAN, "brianknowsanswer");
    
    def give_answer(self, stepname, form):
        print "brian: answer_complete"
        form.add_field(Type.LONGSTRING, "Answer", "Answer: ");
    
#     def ask_manager(self, stepname, form):
#         form.add_task_label(fields=["FirstName", "LastName", "Birthday"]);
#         form.add_field(Type.FLOAT, "Weight");
#         form.add_field(Type.FLOAT, "Temperature");
#         form.add_field(Type.SHORTSTRING, "BloodPressure");
        
if __name__ == '__main__':
    app = BrianApplication();
    app.MainLoop();